Skip to content

feat(party): make party experience bonus configurable - #1610

Open
eduardosmaniotto wants to merge 3 commits into
MUnique:masterfrom
eduardosmaniotto:feat/party-xp-bonus
Open

eduardosmaniotto wants to merge 3 commits into
MUnique:masterfrom
eduardosmaniotto:feat/party-xp-bonus

Conversation

@eduardosmaniotto

@eduardosmaniotto eduardosmaniotto commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements #755

Makes the hard-coded party experience bonus (Math.Pow(1.05, memberCount - 1)) configurable. The defaults keep the current behavior, so existing servers and the 0.75, 0.95d and Season 6 data are unchanged.

  • Party Experience Multiplier: multiplied once per additional party member. Default 1.05.
    Values below 1 penalize larger parties. A value of 0 or less disables the bonus.
  • Set Party Experience Bonus: flat bonus added for a set party. Default 0 (disabled). Zero or negative values are ignored, so a misconfiguration cannot turn the bonus into a penalty.
PartyExperienceMultiplier^(members - 1)  (+ SetPartyExperienceBonus if it is a set party)

A set party has at least three members who all belong to different character class lines (e.g. Dark Wizard, Dark Knight, Fairy Elf).

With the defaults, 2 to 5 members get 5%, 10.25%, 15.76% and 21.55%, exactly as before. The attribute values are floats, so they are rounded to seven decimals. Otherwise 1.05f would give 1.0499999… and differ slightly from the old literal.

Changes

  • Added the two attributes in Stats.cs, and PartyExperienceBonus to calculate the multiplier. Party.cs uses it instead of the hard-coded value.
  • Added the defaults to the game configuration initializer, and to the update plug-ins for 075, 095d and Season 6. The update only adds missing attributes and values, so operator customizations are preserved.
  • Added localization (EN, DE, zh-CN) and documented the behavior in game-configuration.md.
  • The class line is resolved once per member by walking NextGenerationClass. It is not cached across kills, because character classes can be edited at runtime.

Testing

  • dotnet build src/MUnique.OpenMU.sln: result
  • dotnet test tests/MUnique.OpenMU.Tests --filter "FullyQualifiedName~PartyExperienceBonus": result
  • dotnet test tests/MUnique.OpenMU.Persistence.Initialization.Tests --filter "FullyQualifiedName~PartyExperienceBonusAttributes": result

Replace the hard-coded party bonus with the Party Experience
Multiplier and Set Party Experience Bonus attributes, add defaults
and update plugins, and document and test the new behavior.
@codacy-production

codacy-production Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 minor

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
CodeStyle 1 minor

View in Codacy

🟢 Metrics 50 complexity

Metric Results
Complexity 50

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@sven-n sven-n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, making the party experience bonus configurable is useful. But the PR also changes the default for every server, including existing ones through the update plugins:

Members current (1.05^(n−1)) new default (1 + n × 0.01)
2 +5% +2%
3 +10.25% +3%
5 +21.6% +5%

These values come from the Season 8 EXP formula (see the links in #755), and as asked there, Webzen changed the party experience after Season 6. The Season 6 and older data shouldn't silently get a Season 8 balance, and an update plugin shouldn't nerf the party experience of running servers.

Please keep the current behaviour as the default for the existing data initializations (0.75, 0.95d, Season 6), and make the Season 8 style values an option an operator can configure. If the linear formula can't express 1.05^(n−1), the calculation needs a mode (or a factor per member which is multiplied) so the default reproduces today's numbers exactly. A test for the default numbers above would guard that.

The set-party detection (≥ 3 members of different class lines) and the "no negative bonus" guard look good.


Generated by Claude Code

@eduardosmaniotto

Copy link
Copy Markdown
Contributor Author

Thanks for the review, good catch. I reworked it so the defaults keep today's behavior:

  • Party Experience Multiplier is now the per-member multiplier (default 1.05), used as Math.Pow(multiplier, members - 1). The default numbers are the same as before: 5% / 10.25% / 15.76% / 21.55%.
  • 0.75, 0.95d and Season 6 (and the update plugins) all use that default, so running servers aren't changed.
  • Set Party Experience Bonus stays at 0 by default, so it's only added once an operator configures it.
  • I added a test that checks the default numbers for 2-5 members against Math.Pow(1.05, n - 1) exactly.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants